<%@ page language="java" import="java.util.*,com.test.*"
	pageEncoding="utf-8"%>
<%@page import="com.test.classs.*" %>
<%@page import="com.test.connection_hive.*" %>
<%@page import="com.test.dao.*" %>
<%@page import="com.test.page.*" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	//List<IllegalUser> illegalUserList = null;
	//PageInfo pageInfo = null ; 
	
	PageInfo pageInfo =null;
	List<hd_student> studentList=null;
	try {
		hive_SQL.connectionHive();
		pageInfo = new PageInfo(request);
		pageInfo.setPageSize(2) ; 
		studentList = hive_SQL.selectAllHd_student( hive_SQL.stmt, pageInfo);
        System.out.println("studentList="+studentList);
	} catch (Exception e) {
		e.printStackTrace();
	} 
	 
	
%>
<%@taglib prefix="pg" uri="http://jsptags.com/tags/navigation/pager"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<link href="CSS/styles.css" rel="stylesheet" type="text/css" />
	<head>
		<base href="<%=basePath%>">

		<title>My JSP 'showIllegalUser.jsp' starting page</title>

		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

		<style>
<!--
.active {
	float: left;
	list-style: none outside none;
	margin-right: 5px;
	min-width: 20px;
	cursor: pointer;
}
-->
</style>
	</head>
	<body>
		<table id="mytable" cellspacing="0"
			summary="The technical specifications of the Apple PowerMac G5 series">
			<tr>
				<th scope="col" abbr="Dual 1.8">
					序号
				</th>
				<th scope="col" abbr="Dual 1.8">
					登陆名称
				</th>
				<th scope="col" abbr="Dual 1.8">
					访客ip
				</th>
				<th scope="col" abbr="Dual 2">
					访问时间
				</th>
				<th scope="col" abbr="Dual 2.5">
					访问网址
				</th>
				<th scope="col" abbr="Dual 2.5">
					操作结果
				</th>
			</tr>
			<%
				for (int i = 0; i < studentList.size(); i++) {
			%>
			<tr>
				<td class="alt"><%=studentList.get(i).getCid()%></td>
				<td class="alt"><%=studentList.get(i).getAddress()%></td>



			</tr>
			<%
				}
			%>

		</table>

 		<div class="pagination">
	<ul style="height: 30px; padding-left:20px;">
		<pg:pager url="showIllegalUser.jsp" index="half-full"
			items="<%=pageInfo.getTotalResult() %>" maxPageItems="<%=pageInfo.getPageSize() %>"
			export="currentPageNumber=pageNumber" scope="request">
			<pg:first>
				<li class="active"> 
					<a href="<%=pageUrl%>">首页</a>
				</li>
			</pg:first>
			<pg:prev>
				<li class="active">
					<a href="<%=pageUrl%>">上一页 </a>
				</li>
			</pg:prev>
			<pg:pages>
				<li class="active">
				
							<a href="<%=pageUrl%>">    
								<% 
									if(pageNumber == currentPageNumber){
										out.println("<font style='color:red;font-weight:bold;font-size:16px;'>"+pageNumber+"</font>") ; 
									}else{
										out.println(pageNumber) ; 
									}
								%> 
							</a>
						</li>
			</pg:pages>

			<pg:next>
				<li class="active">
					<a href="<%=pageUrl%>">下一页</a>
				</li>
			</pg:next>
			<pg:last>
				<li class="active">
					<a href="<%=pageUrl%>">尾页</a>
				</li>
			</pg:last>
		</pg:pager>
	</ul>
</div>
	</body>
</html>
